package blazingbubble.graphics.game;

import blazingbubble.config.Config;
import blazingbubble.graphics.IActivable;
import blazingbubble.game.command.GameCommandFactory;
import blazingbubble.exception.StartupException;

import java.awt.*;

public class Game implements IActivable {
	private IActivable current;

	private GameStartup gameStartup;
	private InGame inGame;

	public Game(Container displayArea, GameCommandFactory commandFactory, blazingbubble.game.Game game, Integer frameBreak) {
		gameStartup = new GameStartup(displayArea, commandFactory, game);
		inGame = new InGame(displayArea, commandFactory, game, frameBreak);

		current = gameStartup;
	}

	public void gameStarted() {
		inGame.activate();
	}

	public GameStartup getGameStartup() {
		return gameStartup;
	}

	@Override
	public void activate() {
		current.activate();
	}

	public void startup(Config config) {
		inGame.startup(config);
	}
}
